-- include these lines in an initialization handler (see 'home
-- initializations' for more information):
global controlList
put card field "controls" into controlList -- for 'controlKey'
--
on controlKey var
global controlList
put line var of controlList into thingg
if the optionKey is down then
setControls var
else
if thingg is empty then
put "Control code " & var && "not defined."
else
do thingg
end if
end if
end controlKey
on setControls var
global controlList
get the short name of this stack
put line var of controlList into thgg
ask "Control code" && var && "should be(* to blank it):" with thgg
if it is empty then exit setControls
if it = "*" then
put empty into thgg
else
put it into thgg
end if
put thgg into line var of controlList
get the short name of this stack
if it = "Home" then
put thgg into line var of card field "controls" of card "home"
else
put "updating tables in home stack..."
set lockScreen to true
set lockMessages to true
push card
go to card "Home" of stack "Home"
put thgg into line var of card field "controls"
pop card
set lockScreen to false
set lockMessages to false
put empty
hide the message window
end if
end setControls
-- use the following handler if you do not have the control key
-- on your keyboard, but you do have arrow keys
-- This uses the up arrow when the shift key is down. Then it
-- asks for the key that would normally go with the control key.
on arrowKey var
if (the shiftKey is down) AND (var="up") then
ask "Control Key?" with "r"
if it is NOT empty then
put char 1 of it into thingg
put chartonum(thingg)-96 into vv
if vv>0 then controlKey vv
end if
else
pass arrowKey
end if
end arrowKey
-- part contents for background part 5
----- text -----
7/1/88 3:46 PM
-- part contents for background part 4
----- text -----
This set of handlers will let you define a message to be sent for a particular "control-key" combination. The control-key used here is the one that appears on the ADB keyboards of the Mac SE and Macintosh II computers, and not the command (clover) key to the left of the space bar. The list of control-key definitions are kept in a locked, hidden, scrolling field on the Home Card, named "controls". The contents of "controls" is put into global variable "controlList" and is used by the controlKey handler shown below. The controlKey layout corresponds to the letters of the alphabet, i.e. a is 1, b is 2, z is 26, etc. Some other keys are 0 is 48, 1 is 49, 9 is 57, semi-colon is 59, comma is 44, etc. To define a key, just hold down the optionKey along with the controlKey and the key to be defined. A dialog will then appear asking for the message that is to be attached to that controlKey combination. From then on when the controlKey is pressed with that defined key, then the specified message is sent.
Some useful settings might be:
control-r - ResCopy
control-o - thingsToDo (see the "FinderList" Home Improvement)
control-i - generalInfo (see the "GeneralInfo" Home Improvement)